package com.webex.ta.hydra.gui.util;

import java.awt.*;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-9-17
 * Time: 9:17:54
 */
public class ComponentUtil {
    public static void centerComponentInWindow(Component component) {
		Dimension dimension = component.getToolkit().getScreenSize();

		component.setLocation((int) ((dimension.getWidth() - component.getWidth()) / 2),
				(int) ((dimension.getHeight() - component.getHeight()) / 2));
		component.validate();
		component.repaint();
	}
}
